package com.spring.core;

import java.util.Objects;

/**
 * @Description
 * @Author lh
 * @Date 2021-09-29 19:46
 */
public class BeanDefinition {

    private Class classType;

    private String scope;

    private boolean isLazy;

    private String beanName;

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public Class getClassType() {
        return classType;
    }

    public void setClassType(Class classType) {
        this.classType = classType;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public boolean getIsLazy() {
        return isLazy;
    }

    public void setIsLazy(boolean isLazy) {
        this.isLazy = isLazy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BeanDefinition)) return false;
        BeanDefinition that = (BeanDefinition) o;
        return isLazy == that.isLazy && getClassType().equals(that.getClassType()) && getScope().equals(that.getScope()) && getBeanName().equals(that.getBeanName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getClassType(), getScope(), isLazy, getBeanName());
    }
}

